module flow_led (
	input			clk_50m,
	input			rst_n,
	output reg[3:0]	led
);

	localparam T = 10_000_000; // 间隔时间周期次数
	
	reg [25:0] cnt; // 计时器
	
	always @ (posedge clk_50m or negedge rst_n) begin
		if (!rst_n) cnt <= 0;
		else if (cnt < T - 1) cnt <= cnt + 1;
		else cnt <= 0;
	end
	
	always @ (posedge clk_50m or negedge rst_n) begin
		if (!rst_n) led <= 4'b1111;
		else if (led == 4'b1111) led <= 4'b0001;
		else if (cnt == T - 1) led <= {led[2:0], led[3]}; // 计时达到0.2sLED灯移一位
		else led <= led;
	end

endmodule
